<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:p="http://primefaces.org/ui"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		>
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>#{rotulos.labelConsultMetric}</title>
</h:head>
<body>
<p:menubar>
          <p:menuitem value="Home" url="../views/home.jsf"/>
    <p:submenu label="#{rotulos.labelMenuMetricsCategories}" icon="ui-icon-document">
        <p:menuitem value="#{rotulos.labelConsultCategory}" url="../views/consultCategory.jsf"/>
    </p:submenu>
    <p:submenu label="#{rotulos.labelMenuMetrics}" icon="ui-icon-document">
        <p:menuitem value="#{rotulos.labelImportMetrics}" url="../views/registerMetric.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultMetric}" url="../views/consultMetric.jsf" />
        
    </p:submenu>
    <p:submenu label="#{rotulos.labelMenuMetricProjects}" icon="ui-icon-document">
        <p:menuitem value="#{rotulos.labelHeaderCreateProject}" url="../views/createProject.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultProject}" url="../views/consultProject.jsf"/>
    </p:submenu>
    
    <p:submenu label="#{rotulos.labelAdmin}" icon="ui-icon-document" rendered="#{userController.admin}">
        <p:menuitem value="#{rotulos.labelImportMetrics}" url="../admin/registerMetricAdmin.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultMetric}" url="../admin/consultMetricAdmin.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultUser}" url="../admin/consultUser.jsf"/>
        <p:menuitem value="#{rotulos.labelCreateCategory}" url="../admin/registerCategory.jsf"/>
        <p:menuitem value="#{rotulos.labelConsultCategory}" url="../admin/consultCategoryAdmin.jsf"/>
    </p:submenu>
    
    <f:facet name="options">
        <form action="/MetricTools/logoutServlet" method="get">
            <h:commandButton type="submit" value="#{rotulos.labelLogout}"/>
        </form>
    </f:facet>
</p:menubar>

<center>
    <p:panel header="#{rotulos.labelConsultMetric}" style="text-align:left;width:1200x;">
        <h1>#{rotulos.labelMetricsByUser}</h1>

    <p:dataTable var="metric" value="#{registerController.listMetrics}">
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelName}"/>
                </f:facet>
                <h:outputText value="#{metric.name}" />
        </p:column>
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.category}"/>
                </f:facet>
            <h:outputText value="#{metric.category.name}"  />
        </p:column>
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelType}"/>
                </f:facet>
                <h:outputText value="#{metric.type}" />
        </p:column>
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelDomain}"/>
                </f:facet>
                <h:outputText value="#{metric.domain}" />
        </p:column>
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelDescription}"/>
                </f:facet>
                <h:outputText value="#{metric.description}" />
        </p:column>
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelChange}"/>
                </f:facet>
                <h:form>
                    <h:commandButton action="#{registerController.preparaAlterar}" value="#{rotulos.labelChange}"/>
                    </h:form>
         </p:column>
        
                <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelRemove}"/>
                </f:facet>
                <h:form>
                    <h:commandButton action="#{registerController.removeMetric}" value="#{rotulos.labelRemove}"/>
                    </h:form>
         </p:column>
    </p:dataTable>
    
    
        <h1>#{rotulos.labelMetricsDefault}</h1>
    <p:dataTable var="metric" value="#{registerController.listMetricAdmin}">
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelName}"/>
                </f:facet>
                <h:outputText value="#{metric.name}" />
        </p:column>
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.category}"/>
                </f:facet>
            <h:outputText value="#{metric.category.name}"  />
        </p:column>
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelType}"/>
                </f:facet>
                <h:outputText value="#{metric.type}" />
        </p:column>
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelDomain}"/>
                </f:facet>
                <h:outputText value="#{metric.domain}" />
        </p:column>
        <p:column>
                <f:facet name="header">
                    <h:outputText value="#{rotulos.labelDescription}"/>
                </f:facet>
                <h:outputText value="#{metric.description}" />
        </p:column>
    </p:dataTable>
    
    
    </p:panel>
    <center><h:messages infoStyle="color: green" errorStyle="color: red"/><br/></center>
    </center>
    </body>
</html>
